<template>
  <div class="titleColumn" :class="{isColumn: isColumn}">
    <div class="titleName">
      <span :data-text="name">{{ name }}</span>
    </div>
    <div class="rightSlot"><slot></slot></div>
  </div>
</template>

<script lang="ts" setup>
  defineOptions({ name: 'TitleColumn' });
  defineProps({
    name: { type: String },
    isColumn: { type: Boolean, default: false }
  });
</script>

<style lang="less" rel="stylesheet/less" scoped>
  .titleColumn {
    width: 100%;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    background: url(@/assets/images/title_bg.png) no-repeat;
    background-size: 100% 100%;
    .titleName {
      display: flex;
      align-items: center;
      width: 50%;
      span {
        display: inline-block;
        width: 100%;
        position: relative;
        font-size: 18px;
        font-weight: bold;
        font-style: italic;
        color: transparent;
        padding-right: 6px;
        margin-left: 30px;
        letter-spacing: 2px;
        &::before {
          content: attr(data-text);
          width: 100%;
          position: absolute;
          top: 0;
          left: 0;
          z-index: 100;
          padding-right: 10px;
          background: linear-gradient(180deg, #FFFFFF 43.33%, #06B7FD 110%);
          -webkit-background-clip: text;
          color: transparent;
        }
        &::after {
          content: attr(data-text);
          width: 100%;
          position: absolute;
          top: 0;
          left: 0;
          z-index: 0;
          text-shadow: 0px 4px 4px rgba(0, 0, 0, 0.8);
        }
      }
    }
    .rightSlot {
      max-width: 50%;
      position: absolute;
      right: 0;
    }
  }
  .isColumn {
    width: calc(100% - 10px);
    background: url(@/assets/images/title_bg2.png) no-repeat;
    background-size: contain;
  }
</style>
